<template>
  <div class="p-count">
    <div class="p-Num">
      <div class="p-head"><i>人流量预警</i><b>{{peopleData}}%</b></div>
      <!--人流量占比-->
      <ul class="type-length">
        <template>
          <li :style="{width: chooseWidth()}"></li>
        </template>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  name: 'peopleNum',
  data () {
    return {
      peopleData: 78
    }
  },
  mounted () {
    // this.init();
  },
  methods: {
    chooseWidth () {
      let w = (this.peopleData / 100) * 230
      return w + 'px'
    }
  }
}
</script>

<style scoped>
  .p-count {
    width: 100%;
    margin-bottom: 10px;
  }

  .p-Num {
    width: 100%;
    background: rgba(43, 54, 72, 0.95);
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    padding: 20px;
    box-sizing: border-box;
  }

  .p-head {
    color: #fff;
    height: 37px;
  }

  .p-head i {
    float: left;
    font-size: 12px;
    font-style: normal;
  }

  .p-head b {
    font-weight: normal;
    font-size: 33px;
    float: right;
    color: #F5A623;
    margin-top: -15px;
  }

  .type-length {
    width: 100%;
    margin-top: 5px;
    background: rgba(0, 0, 0, 0.20);
  }

  .type-length li {
    list-style: none;
    height: 10px;
    background: #FF9900;
    margin-bottom: 10px;
    margin-right: 2px;
  }

</style>
